package com.mdxl.controller;

import com.mdxl.rabbitMQ.HelloSender;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/rabbitmq")
public class RabbitMQController {

    @Autowired
    private HelloSender helloSender;
    //一对一
    @PostMapping("/hello")
    public void hello()  {
        helloSender.send();
    }
    //一对多
    @PostMapping("/onetomany")
    public void onetomant(){
        for (int i=0;i<100;i++){
            helloSender.send();
        }
    }
}
